# x = 10
# y = x**4   # ** 后面的数字，代表的是几次方
#
# print(y)
# import random

# from selenium.webdriver.common.devtools.v135.util import event_class

# data = {11,'mmmm'}
# temp = {"you",1}
# print(type(temp))
#
#
# str1 = 'hello'
# str2 = 'world'
# print(str1+' '+str2)
# a = 10
# b = 10.11
# a = b
# str1 = 'hello'
# a = str1
# b = str1
# print(b)
# print(a)

# def func (a,b):
#     return a+b
#
# num  = {1,2,3,4,5,6,7}
# for i in num:
#     if i==4:
#         print(i)
#         print(i+1)
#         print(i+3)
#
# """
# 这是注释这是注释
# """
# # 这是注释
# print(func(1,2))
# num = 10
# print(f'num = {num}')
# print(f'str1={num}')

#
# num1 = 10
# num2 = input('请输入一个值: ')
# print(f'num1+num2={num1+float(num2)}')
#
# # int(str)   将str变为一个int类型
# # 对本身括号里面的变量不会做改变
#
# num3 = str(num1)
#
# print(type(num1))
# print(type(num3))

# print(10//3)   #// 向下取整
#
# print(0.1+0.300000000000)
#
# print((0.1+0.3)==0.4)

# print(1 and 0)
# print(0 or 0)
# print(not 1)
#
# print(True and False)
# print(False or True)

# a = 1100
# b = 1100
#
# if a>b:
#     print('a>b')
#     print('a>b')
# elif a==b:
#     print('a==b')
#     print('a==b')
# elif a<b:
#     print('a<b')
#     print('a<b')


# while n!=0:
#     n-=1
#     count+=1
# print(count)
# n = 10
# count = 0
# for n in range(-1,10,1):    #这是把range里面的值赋值给n,赋值后+1
#     if n==-1:
#         print('n==-1')
#     count+=1
#     print(n)
# print(count)


# print(random.random())
# print(random.SystemRandom().random())
# print(random.Random().random())
# print(random.seed())
# print(random.choice([11111,11,22,33,4,4,66,778]))
# # print(random.randint(1,7))
#
#
# random1 = random.Random()
# random1.seed()
# print(random1.randint(1,7))

# 设置种子
# random.seed(42)  # 可以使用任何整数作为种子

# # 生成随机数
# print(random.random())  # 输出: 0.6394267984578837
# print(random.randint(1, 10))  # 输出: 7
# print(random.choice(['a', 'b', 'c', 'd']))  # 输出: 'a'
#
# # 再次设置相同的种子
# random.seed(42)
#
# # 再次生成随机数
# print(random.random())  # 输出: 0.6394267984578837
# print(random.randint(1, 10))  # 输出: 7
# print(random.choice(['a', 'b', 'c', 'd']))  # 输出: 'a'

# x = 10
#
# def func():
#     global x
#     x+=1
#
# func()
#
# print(x)
#
# def a():
#     num1 = 10
#     print(f'a()-> {num1}')
# def b():
#     num1 = 20
#     a()
#     print(f'b()-> {num1}')
# def c():
#     num1 = 30
#     b()
#     print(f'c()-> {num1}')
# def d():
#     num1 = 40
#     c()
#     print(f'd() -> {num1}' )
#
# d()

#
# alist=list()
#
# nlist = [1,2,3,4,5,6,7]
#
#
# print(nlist[1:4:1])
# print('---------')
# print(nlist[:4:2])
# print('---------')
# print(nlist[1::3])
# print('---------')
# print(nlist[1:-1:4])
#
# str1 = str()
#
# print(str1)
# for a in alist:
#     print(a)
# print()   #类似与换行
# for n in nlist:
#     print(n)
#


#list相关接口的使用


# def print(alist):
#     for item in alist:
#         print(item)

# alist = list()
#
# print(alist)
#
# alist.append(1)
# alist.append(2)
# alist.append(3)
# alist.append(4)
# alist.append(5)
# print(alist)
# alist.insert(1,20)
# print(alist)
#
# alist.sort()
# print(alist)
#
# alist.pop()
# print(alist)
#
# print(alist.index(2))
# print(4 not in alist)
# blist = [10,20,30,40,50]
#
# alist.extend(blist)
# print(alist)
# print(blist)

# # 元组
#
# tup1 = (1,2,3,4,5,6,7,8,8,8,8,9,10,11,12,13,14,15,16,17,18,19,20)
# tup2 = tuple()
# print(type(tup1))
# print(type(tup2))
#
# print(tup1.count(8))   # 统计有多少个
# print(tup1.index(8))
# print(tup1.index(5))

####  字典

# ddict1 = {}
# ddict2 = dict()
# ddict2['id'] = 10
# ddict2['name'] = '李四'
# ddict2['gender'] = '男'
# ddict2['tel'] = '123456'
#
# print(ddict2.values())
# print(ddict2.keys())
# print(ddict2.get('id'))
# print(ddict2.pop('tel'))
# ddict2.update({'qq':'1111111'})
# ddict2['id'] = 20
# print(ddict2['id'])
# print(ddict2)


# f = open('Myfile.txt','r')
# #f.write('hello world')
#
# #print(f.read())  # 全部读出来
#
# for line in f:
#     print(line,end='')
#     # 因为print函数会自动添加换行   但是文件中每一行已经存在换行符了，所以这里不需要print自动添加换行符，
#     # 可以设定print末尾自动添加的字符
# print(f.readlines())
#
# f.close()
#
#
# with open('Myfile.txt','w',encoding = 'utf8') as f:
#     f.write('hello world!')
#
# import datetime
# def myreverse(string):
#     alist = string.split(' ')
#     alist.reverse()
#     return ' '.join(alist)
# print(myreverse('I am a student.'))
#
#
# date = datetime.datetime(2022,7,2)
# date2 = datetime.datetime(2025,6,14)
#
# print(date2-date)
#
# print(datetime.date.today())
# print(datetime.datetime.today())
# print(datetime.time())
#
# # s旋转后是否能变成goal    'abcd'-->'bcda'
# def rotate(str1,goal):
#     return len(str1)==len(goal) and str1 in goal+goal
#
# print(rotate('abcd','bcda'))


# def findPre(words,s):
#     ret = 0
#     for word in words:
#         s.startswith(word)
#         ret+=1
#     return ret
#
# words = ['abcd','abc','abbcd']
# s = 'ab'
# print(findPre(words,s))
#
#
# import os
# os.walk(searchPath)   返回当前路径   当前路径下的目录（多个） 当前路径下的文件（多个）

# searchPath = input('请输入搜索路径: ')
# filename = input('请输入搜索文件名: ')
# for root,dirs,files in os.walk(searchPath):
#     for file in files:
#         if file==filename:
#             print(f'找到了:{file}')
#
# curDir = os.getcwd()
# print(curDir)

# print(os.chdir(path))   #os.chdir  改变当前工作目录为path


# import qrcode
# from qrcode import make
#
# img = qrcode.make('玫瑰带刺吗？')
# type(img)  # qrcode.image.pil.PilImage
# img.save("some_file.png")
# import qrcode
# qr = qrcode.QRCode(
#     version=1,
#     error_correction=qrcode.constants.ERROR_CORRECT_L,
#     box_size=10,
#     border=4,
# )
# qr.add_data('玫瑰带刺吗？')
# qr.make(fit=True)
#
# img = qr.make_image(fill_color="black", back_color="white")

# import qrcode
#
# img = qrcode.make("玫瑰带刺吗？")
# type(img)
# img.save('玫瑰.png')

#
# import qrcode
# print(dir(qrcode))  # 查看 qrcode 模块的属性和方法


# import qrcode
#
# qr = qrcode.QRCode(
#     version=1,
#     error_correction=qrcode.constants.ERROR_CORRECT_L,
#     box_size=10,
#     border=4,
# )
# qr.add_data("玫瑰带刺吗？")
# qr.make(fit=True)
#
# img = qr.make_image(fill_color="black", back_color="white")
# img.save("玫瑰.png")







